package club.hicode.daydayup.vmware;

import com.vmware.vim25.AboutInfo;
import com.vmware.vim25.mo.Folder;
import com.vmware.vim25.mo.InventoryNavigator;
import com.vmware.vim25.mo.ServiceInstance;

import java.net.URL;

/**
 * Client
 *
 * @author Liu Chunfu
 * @date 2018-07-31 下午2:20
 **/

public class Client {
    public static void main(String[] args) {

        try {
            ClientSesion session = new ClientSesion("172.16.1.20", "root", "vmware");
            URL url = new URL("https", session.getHost(), "/sdk");
            ServiceInstance si = new ServiceInstance(url, session.getUsername(), session.getPassword(), true);

            Folder rootFolder = si.getRootFolder();
            InventoryNavigator navigator = new InventoryNavigator(rootFolder);
            //VCenter vc = new VCenter();
            AboutInfo ai = si.getAboutInfo();
            System.out.println("名称" + ai.getFullName());
            System.out.println("版本：" + ai.getVersion());
            //            System.out.println(ai.apiType);
            //            si.currentTime();
        } catch (Exception e) {
            e.printStackTrace();
        }


    }
}



